import Vue from 'vue';
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'

// 引入element UI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App';
// 引入路由
import router from './router';
// 引入状态管理
import store from './store';
// 引入icon
import './assets/icon/iconfont.css'
// 引入echarts
import echarts from 'echarts'
// import '../src/icons' // icon
Vue.prototype.$echarts = echarts
import tagCloud from 'v-tag-cloud'
Vue.use(tagCloud)
import axios from 'axios';
Vue.prototype.$axios = axios;

import Chat from 'jwchat';
Vue.use(Chat)

Vue.config.productionTip = false;
// use
Vue.use(mavonEditor)
// 使用element UI
Vue.use(ElementUI);
// 过滤器
import * as custom from './utils/util'

Object.keys(custom).forEach(key => {
    Vue.filter(key, custom[key])
})

new Vue({
    el: '#app',
    router,
    store, // 使用store vuex状态管理
    mavonEditor,
    components: { App },
    template: '<App/>',
    data: {
        // 空的实例放到根组件下，所有的子组件都能调用
        Bus: new Vue()
    }

})
